﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CARMSData.CollectionClasses;
using CARMSData.EntityClasses;
using CARMSData.HelperClasses;

namespace CARMSBusiness
{
   public class ReportBusiness
    {
       public static int GetReportHeaderIDByReportNumber(string strReportNumber)
       {
           var collection = new ReportHeaderCollection();
           collection.GetMulti(ReportHeaderFields.ReportCode == strReportNumber);
           if(collection.Count>0)
           {
               return collection[0].ReportHeaderId;
           }
           return 0;
       }

       public static ReportHeaderEntity GetReportHeaderEntityByReportNumber(string strReportNumber)
       {
           var collection = new ReportHeaderCollection();
           collection.GetMulti(ReportHeaderFields.ReportCode == strReportNumber);
           if (collection.Count > 0)
           {
               return collection[0];
           }
           return  null;
       }

    }
}
